security: run Etherpad container as non-root user (fixes #7134)#7287
Conversation
Change the Docker Compose user from "0:0" (root) to "5001:0" (etherpad user) to follow security best practices and the principle of least privilege. The Dockerfile already creates a non-root user 'etherpad' with UID 5001 and GID 0, so this change aligns the docker-compose.yml configuration with the Dockerfile's security model. Benefits: - Reduces attack surface by not running as root - Follows Docker security best practices - Aligns with the Dockerfile's existing non-root user setup - Compatible with OpenShift and other platforms that restrict root containers - Maintains group permissions (GID 0) for volume access Fixes ether#7134
There was a problem hiding this comment.
Pull request overview
This PR addresses a security concern by changing the Docker Compose configuration to run Etherpad as a non-root user instead of root, aligning with the principle of least privilege and the Dockerfile's existing security design.
Changes:
- Modified
docker-compose.ymlto run the Etherpad container as user5001:0(etherpad user with root group) instead of0:0(root user)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| services: | ||
| app: | ||
| user: "0:0" | ||
| user: "5001:0" |
There was a problem hiding this comment.
The README.md file contains a docker-compose example that still has user: "0:0" on line 51. For consistency and to fully address issue #7134, this example should also be updated to user: "5001:0" to match the change made in docker-compose.yml. The issue specifically mentioned that the README's compose file should be updated as well.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
Thanks for the fix :) |
|
Thank you. |
|
Thank you for fixing this issue :) |
Description
This PR addresses a security concern raised in issue #7134 by changing the Docker Compose configuration to run the Etherpad container as a non-root user instead of root.
Problem
The current
docker-compose.ymlexplicitly setsuser: "0:0", which runs the Etherpad application as the root user inside the container. This violates the principle of least privilege and creates unnecessary security risks.Solution
Changed the user from
"0:0"(root) to"5001:0"(etherpad user with root group) to align with the Dockerfile's existing security model.The Dockerfile already creates a non-root user named
etherpadwith:This change simply makes the docker-compose.yml configuration consistent with the Dockerfile's security design.
Changes Made
user: "0:0"touser: "5001:0"Benefits
🔒 Security Improvements
🚀 Platform Compatibility
🔧 Technical Alignment
Testing
Verification Steps
Recommended Testing
Security Impact
Before
After
Compatibility
Related Issues
Fixes #7134
Additional Context
This change was requested by @techware01 in issue #7134, and @SamTV12345 asked for a merge request. The Dockerfile has always created a non-root user, so this change simply makes the docker-compose.yml configuration consistent with that design.
Checklist
Note: This is a security improvement with minimal risk. The Dockerfile already runs as non-root, so this change simply removes the override that forced root execution in docker-compose deployments.